home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagn_r.zip
/
RECORDS.SWG
/
0008_Fast Delete Typed Records.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-05-31
|
987b
|
37 lines
BG>JB>A method that I have successfully used to delete records in place is
BG>JB>to...
'Scuse me for butting in, but I have another approach which will
preserve your record order. I will present it for a file of records
the total size of which is less than 64K. The routine may easily be
adapted for large files:
procedure del_rec(fname : string;target : longint;rec_size : longint);
type
t_buf=array[1..65520] of byte;
var
f : file;
buf : t_buf;
n : word;
begin
new(buf);
assign(f,fname); { open your file }
reset(f,1);
blockread(f,buf,sizeof(buf),n);
close(f);
move(bufsucc(target)*rec_size],buftarget*rec_size],n-(target*rec_size));
dec(n,rec_size);
rewrite(f,1);
blockwrite(f,buf,n);
close(f);
dispose(buf);
end;
---
* The Right Place (tm) BBS/Atlanta - 404/476-2607 SuperRegional Hub
* PostLink(tm) v1.05 TRP (#564) : RelayNet(tm)
---
■ OLX 2.1 TD ■ I just steal 'em, I don't explain 'em.